package b2.config
{
	public class TankConfig extends CommonObjConfig
	{
		public static const EQUIP_SLOT_AVAILABLE:Array = [0, 0, 1, 2, 3, 3, 0, 0, 4, 4];
 		//生命值
		public var healthPoint:Array;
		//攻击
		public var attackPoint:Array;
		//暴击率
		public var criticalAttackRatio:Array;
		//防御
		public var armPoint:Array;
		//能量
		public var energyPoint:Array;
		//战力
		public var fightPoint:Array;
		//移动速度
		public var moveVelocity:int;
		//发炮间隔
		public var fireCooldown:int;
		//类型
		public var model:int;
		//图片
		public var fightImage:String;
		
		public function TankConfig(tankXML:XML)
		{
			super(tankXML);
			if (tankXML.healthPoint != undefined)
				healthPoint = tankXML.healthPoint.split(",");
			if (tankXML.attackPoint != undefined)
				attackPoint = tankXML.attackPoint.split(",");
			if (tankXML.criticalAttackRatio != undefined)
				criticalAttackRatio = tankXML.criticalAttackRatio.split(",");
			if (tankXML.armPoint != undefined)
				armPoint = tankXML.armPoint.split(",");
			if (tankXML.energyPoint != undefined)
				energyPoint = tankXML.energyPoint.split(",");
			if (tankXML.fightPoint != undefined)
				fightPoint = tankXML.fightPoint.split(",");
			moveVelocity = tankXML.moveVelocity;
			fireCooldown = tankXML.fireCooldown;
			model = tankXML.model;
			fightImage = tankXML.fightImage;
		}
		
		public function getDescription(quality:int):String
		{
			var descrip:String = "";
			descrip += "攻击: <font color='#00AA00'>" + parseInt(attackPoint[quality]) + "</font>\t" + 
					"防御: <font color='#00AA00'>" + parseInt(armPoint[quality]) + "</font><br>";
			descrip += "生命: <font color='#00AA00'>" + parseInt(healthPoint[quality]) + "</font>\t" + 
					"暴击: <font color='#00AA00'>" + parseInt(criticalAttackRatio[quality]) + "</font><br>";
			descrip += "能量: <font color='#00AA00'>" + parseInt(energyPoint[quality]) + "</font><br>";
			descrip += "描述: " + description;
			return descrip;
		}
	}
}